//
//  UserModel.m
//  LoveLove
//
//  Created by leiyifan on 2019/5/24.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "UserModel.h"

@implementation UserModel
+(void)getUserInfo:(void(^)(void))complete
{
        NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
        NSString *user_id = [userdefault objectForKey:@"user_id"];
        NSString *user_random = [userdefault objectForKey:@"user_random"];
        NSDictionary *dic = @{@"edu_id":@"18",@"user_id":user_id,@"user_random":user_random};
        [self showSVProgressHUD];
        [LLHttpTool post:LLHOST headParams:nil params:dic success:^(NSDictionary *result) {
            if ([result[@"code"] integerValue] == 0) {
                LLUserInfo *user =  [[LLUserInfo alloc] initWithDic:result[@"data"]];
                user.user_id = user_id;
                user.isLogin = YES;
            }else{
                complete();
            }
            

        } failure:^(NSString *msg) {

            [SVProgressHUD showErrorWithStatus:msg];
        }];
}

@end
